<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ROSS: core/buddy.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <a href="https://github.com/ROSS-org/ROSS">
   <div id="projectname">ROSS
   </div>
   </a>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_af18cf245e3394ab3b436135935cfd6e.html">core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">buddy.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Buddy-system memory allocator.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;sys/queue.h&gt;</code><br/>
</div>
<p><a href="buddy_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structbuddy__list.html">buddy_list</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structbuddy__list__bucket.html">buddy_list_bucket</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:adcd960f6050174cbf799e5bca60aea48"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#adcd960f6050174cbf799e5bca60aea48">BUDDY_ALIGN_PREF</a>&#160;&#160;&#160;(32 - 2 * sizeof(void*) - sizeof(uint32_t) - sizeof(<a class="el" href="buddy_8h.html#a21e0915fcd423dccf0a145edec34ebe8">purpose_t</a>))</td></tr>
<tr class="separator:adcd960f6050174cbf799e5bca60aea48"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a21e0915fcd423dccf0a145edec34ebe8"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9">purpose</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#a21e0915fcd423dccf0a145edec34ebe8">purpose_t</a></td></tr>
<tr class="separator:a21e0915fcd423dccf0a145edec34ebe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa75928b4c911a0d613473267a0585d6d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structbuddy__list.html">buddy_list</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#aa75928b4c911a0d613473267a0585d6d">buddy_list_t</a></td></tr>
<tr class="separator:aa75928b4c911a0d613473267a0585d6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa7362f730dd0743731a2b0b0082fb88"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35">valid</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#aaa7362f730dd0743731a2b0b0082fb88">valid_t</a></td></tr>
<tr class="separator:aaa7362f730dd0743731a2b0b0082fb88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a676bc3bde2d2bce99f474f3e0b20700d"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structbuddy__list__bucket.html">buddy_list_bucket</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#a676bc3bde2d2bce99f474f3e0b20700d">buddy_list_bucket_t</a></td></tr>
<tr class="separator:a676bc3bde2d2bce99f474f3e0b20700d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ae2694cc0545e0b4d3fc4a32ab1b33ce9"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9">purpose</a> { <a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9acc62d1576546f3245237e1b232d838b6">FREE</a>, 
<a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9a1e780c62cb3fd2edcac39f739bbe6f6c">USED</a>
 }</td></tr>
<tr class="separator:ae2694cc0545e0b4d3fc4a32ab1b33ce9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51646327ac0a3287c4b08e4d28b66f35"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35">valid</a> { <a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35acf0713491d9b887eaccfd80c18abca47">VALID</a>, 
<a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35aef2863a469df3ea6871d640e3669a2f2">INVALID</a>
 }</td></tr>
<tr class="separator:a51646327ac0a3287c4b08e4d28b66f35"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac7158d51ffbe54dd3e04d6568f90c42c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="buddy_8h.html#a676bc3bde2d2bce99f474f3e0b20700d">buddy_list_bucket_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#ac7158d51ffbe54dd3e04d6568f90c42c">create_buddy_table</a> (unsigned int power_of_two)</td></tr>
<tr class="separator:ac7158d51ffbe54dd3e04d6568f90c42c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9dd0e2ab55c7090670a556e026f515c"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#aa9dd0e2ab55c7090670a556e026f515c">buddy_alloc</a> (unsigned size)</td></tr>
<tr class="separator:aa9dd0e2ab55c7090670a556e026f515c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d38d5280dce5d4f0b85410e00c293a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="buddy_8h.html#a2d38d5280dce5d4f0b85410e00c293a6">buddy_free</a> (void *ptr)</td></tr>
<tr class="separator:a2d38d5280dce5d4f0b85410e00c293a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="adcd960f6050174cbf799e5bca60aea48"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BUDDY_ALIGN_PREF&#160;&#160;&#160;(32 - 2 * sizeof(void*) - sizeof(uint32_t) - sizeof(<a class="el" href="buddy_8h.html#a21e0915fcd423dccf0a145edec34ebe8">purpose_t</a>))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="buddy_8h_source.html#l00013">13</a> of file <a class="el" href="buddy_8h_source.html">buddy.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a676bc3bde2d2bce99f474f3e0b20700d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structbuddy__list__bucket.html">buddy_list_bucket</a>  <a class="el" href="buddy_8h.html#a676bc3bde2d2bce99f474f3e0b20700d">buddy_list_bucket_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Bucket of 2^order sized free memory blocks. </p>

</div>
</div>
<a class="anchor" id="aa75928b4c911a0d613473267a0585d6d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structbuddy__list.html">buddy_list</a>  <a class="el" href="buddy_8h.html#aa75928b4c911a0d613473267a0585d6d">buddy_list_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Metadata about this particular block (and stored at the beginning of this block). One per allocated block of memory. Should be 32 bytes to not screw up alignment. </p>

</div>
</div>
<a class="anchor" id="a21e0915fcd423dccf0a145edec34ebe8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9">purpose</a>  <a class="el" href="buddy_8h.html#a21e0915fcd423dccf0a145edec34ebe8">purpose_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aaa7362f730dd0743731a2b0b0082fb88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35">valid</a>  <a class="el" href="buddy_8h.html#aaa7362f730dd0743731a2b0b0082fb88">valid_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ae2694cc0545e0b4d3fc4a32ab1b33ce9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="buddy_8h.html#ae2694cc0545e0b4d3fc4a32ab1b33ce9">purpose</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ae2694cc0545e0b4d3fc4a32ab1b33ce9acc62d1576546f3245237e1b232d838b6"></a>FREE</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ae2694cc0545e0b4d3fc4a32ab1b33ce9a1e780c62cb3fd2edcac39f739bbe6f6c"></a>USED</em>&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="buddy_8h_source.html#l00011">11</a> of file <a class="el" href="buddy_8h_source.html">buddy.h</a>.</p>

</div>
</div>
<a class="anchor" id="a51646327ac0a3287c4b08e4d28b66f35"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="buddy_8h.html#a51646327ac0a3287c4b08e4d28b66f35">valid</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a51646327ac0a3287c4b08e4d28b66f35acf0713491d9b887eaccfd80c18abca47"></a>VALID</em>&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a51646327ac0a3287c4b08e4d28b66f35aef2863a469df3ea6871d640e3669a2f2"></a>INVALID</em>&#160;</td><td class="fielddoc">
</td></tr>
</table>

<p>Definition at line <a class="el" href="buddy_8h_source.html#l00030">30</a> of file <a class="el" href="buddy_8h_source.html">buddy.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aa9dd0e2ab55c7090670a556e026f515c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* buddy_alloc </td>
          <td>(</td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find the smallest block that will contain size and return it. Note this returns the memory allocated and usable, not the entire buffer. This may involve breaking up larger blocks. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>The size of the data this allocation must be able to hold. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="buddy_8c_source.html#l00234">234</a> of file <a class="el" href="buddy_8c_source.html">buddy.c</a>.</p>

<p>References <a class="el" href="buddy_8c_source.html#l00197">buddy_split()</a>, <a class="el" href="buddy_8h_source.html#l00038">buddy_list_bucket::count</a>, <a class="el" href="ross-global_8c_source.html#l00036">g_tw_buddy_master</a>, <a class="el" href="buddy_8h_source.html#l00030">INVALID</a>, <a class="el" href="buddy_8h_source.html#l00040">buddy_list_bucket::is_valid</a>, <a class="el" href="buddy_8c_source.html#l00023">next_power2()</a>, <a class="el" href="buddy_8h_source.html#l00039">buddy_list_bucket::order</a>, <a class="el" href="tw-util_8c_source.html#l00074">tw_error()</a>, <a class="el" href="ross-extern_8h_source.html#l00164">TW_LOC</a>, <a class="el" href="buddy_8h_source.html#l00026">buddy_list::use</a>, and <a class="el" href="buddy_8h_source.html#l00011">USED</a>.</p>

<p>Referenced by <a class="el" href="tw-state_8c_source.html#l00021">tw_snapshot_delta()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_cgraph.png" border="0" usemap="#buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_cgraph" alt=""/></div>
<map name="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_cgraph" id="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_cgraph">
<area shape="rect" id="node2" href="buddy_8c.html#a3caec5f80ecae355c6674d9aef1ccfef" title="buddy_split" alt="" coords="148,5,236,32"/><area shape="rect" id="node3" href="buddy_8c.html#a8359775791de03af6f115e84249141b1" title="next_power2" alt="" coords="144,56,240,83"/><area shape="rect" id="node4" href="ross-extern_8h.html#a49ed2388aaae26e43280b7909c834aaa" title="tw_error" alt="" coords="157,107,227,133"/><area shape="rect" id="node5" href="network-mpi_8c.html#a2e139e8547a091c4c4ea0b445fe8dd1c" title="tw_net_abort" alt="" coords="289,107,386,133"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_icgraph.png" border="0" usemap="#buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_icgraph" alt=""/></div>
<map name="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_icgraph" id="buddy_8h_aa9dd0e2ab55c7090670a556e026f515c_icgraph">
<area shape="rect" id="node2" href="tw-state_8c.html#a23a06d48ada7a6f453ea34d6175516fd" title="tw_snapshot_delta" alt="" coords="144,5,275,32"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a2d38d5280dce5d4f0b85410e00c293a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void buddy_free </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Free the given pointer (and coalesce it with its buddy if possible). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>The pointer to free. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="buddy_8c_source.html#l00137">137</a> of file <a class="el" href="buddy_8c_source.html">buddy.c</a>.</p>

<p>References <a class="el" href="buddy_8c_source.html#l00080">buddy_try_merge()</a>, <a class="el" href="buddy_8h_source.html#l00038">buddy_list_bucket::count</a>, <a class="el" href="buddy_8h_source.html#l00011">FREE</a>, <a class="el" href="ross-global_8c_source.html#l00036">g_tw_buddy_master</a>, <a class="el" href="buddy_8h_source.html#l00039">buddy_list_bucket::order</a>, <a class="el" href="buddy_8h_source.html#l00025">buddy_list::size</a>, <a class="el" href="ross-extern_8h_source.html#l00164">TW_LOC</a>, <a class="el" href="tw-util_8c_source.html#l00061">tw_printf()</a>, <a class="el" href="buddy_8h_source.html#l00026">buddy_list::use</a>, and <a class="el" href="buddy_8h_source.html#l00011">USED</a>.</p>

<p>Referenced by <a class="el" href="ross-inline_8h_source.html#l00097">tw_event_free()</a>, <a class="el" href="tw-event_8c_source.html#l00181">tw_event_rollback()</a>, and <a class="el" href="tw-eventq_8h_source.html#l00049">tw_eventq_push_list()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_cgraph.png" border="0" usemap="#buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_cgraph" alt=""/></div>
<map name="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_cgraph" id="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_cgraph">
<area shape="rect" id="node2" href="buddy_8c.html#a79eb8604ccdede86583f1faccec9dfb9" title="buddy_try_merge" alt="" coords="141,5,264,32"/><area shape="rect" id="node3" href="ross-extern_8h.html#a9fdd5173071664ba458fbd0d2419713e" title="tw_printf" alt="" coords="167,56,239,83"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_icgraph.png" border="0" usemap="#buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_icgraph" alt=""/></div>
<map name="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_icgraph" id="buddy_8h_a2d38d5280dce5d4f0b85410e00c293a6_icgraph">
<area shape="rect" id="node2" href="ross-inline_8h.html#ad46705159e8a344f46b9e2943774cf85" title="tw_event_free" alt="" coords="160,17,264,44"/><area shape="rect" id="node3" href="tw-event_8c.html#ad90c1310a5aeee6d9bff67237f3e9913" title="tw_event_rollback" alt="" coords="350,151,477,177"/><area shape="rect" id="node16" href="tw-eventq_8h.html#abcb2f5e59834cc2566395b4732cb2f32" title="tw_eventq_push_list" alt="" coords="141,68,283,95"/><area shape="rect" id="node4" href="tw-kp_8c.html#a5b88c07fbc4f7810bdc676306013b513" title="tw_kp_rollback_to" alt="" coords="555,252,682,279"/><area shape="rect" id="node12" href="tw-kp_8c.html#a64819ac4aba17987e01bb13142e78c86" title="tw_kp_rollback_event" alt="" coords="545,151,693,177"/><area shape="rect" id="node14" href="tw-sched_8c.html#ad27b3474d878cedfe1a1f993093d8715" title="tw_sched_batch" alt="" coords="560,201,677,228"/><area shape="rect" id="node15" href="tw-sched_8c.html#a1586b72acaa34a4ef8cc6aadabe9711e" title="tw_sched_batch_realtime" alt="" coords="741,56,912,83"/><area shape="rect" id="node5" href="tw-sched_8c.html#a0bb0520414480154343b267735636433" title="tw_sched_event_q" alt="" coords="761,107,892,133"/><area shape="rect" id="node11" href="tw-sched_8c.html#ad49988d8dcde406fac7f4a2e11eac17f" title="tw_scheduler_optimistic\l_debug" alt="" coords="969,230,1132,271"/><area shape="rect" id="node6" href="tw-sched_8c.html#ab3e02a0e976921bd18a11b8b6a00c110" title="tw_scheduler_conservative" alt="" coords="961,40,1141,67"/><area shape="rect" id="node9" href="tw-sched_8c.html#a1ebf9585a3de4d61c5fc050c7600fcd8" title="tw_scheduler_optimistic" alt="" coords="969,157,1132,184"/><area shape="rect" id="node10" href="tw-sched_8c.html#accfa49d85bd68f2c53d4a08cf64ace88" title="tw_scheduler_optimistic\l_realtime" alt="" coords="969,91,1132,133"/><area shape="rect" id="node7" href="tw-setup_8c.html#a6dbc4bba03285bb1b8a8a5464f0375ea" title="tw_run" alt="" coords="1189,128,1251,155"/><area shape="rect" id="node8" href="phold_8c.html#a3c04138a5bfe5d72780bb7e82a18e627" title="main" alt="" coords="1299,128,1349,155"/><area shape="rect" id="node13" href="tw-sched_8c.html#abe0eb975865f0cde7f2c2e3129bd18d7" title="tw_sched_cancel_q" alt="" coords="758,157,895,184"/><area shape="rect" id="node17" href="tw-eventq_8h.html#a8cee9de44c05a95ae003767f7299d9c4" title="tw_eventq_fossil_collect" alt="" coords="331,24,496,51"/><area shape="rect" id="node18" href="tw-pe_8c.html#a36f9f2e3925202eae4c7cb42f913280c" title="tw_pe_fossil_collect" alt="" coords="549,12,689,39"/><area shape="rect" id="node19" href="ross-gvt_8h.html#a0d905b32b2567dd637c4926872622a70" title="tw_gvt_step2" alt="" coords="777,5,877,32"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac7158d51ffbe54dd3e04d6568f90c42c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="buddy_8h.html#a676bc3bde2d2bce99f474f3e0b20700d">buddy_list_bucket_t</a>* create_buddy_table </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>power_of_two</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Pass in the power of two e.g., passing 5 will yield 2^5 = 32. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">power_of_two</td><td>The largest "order" this table will support. </td></tr>
  </table>
  </dd>
</dl>
<p>&lt;Minimum block order</p>
<p>&lt;Minimum block order</p>
<p>&lt;Minimum block order</p>
<p>&lt;Minimum block order </p>

<p>Definition at line <a class="el" href="buddy_8c_source.html#l00288">288</a> of file <a class="el" href="buddy_8c_source.html">buddy.c</a>.</p>

<p>References <a class="el" href="buddy_8c_source.html#l00015">buddy_base_address</a>, <a class="el" href="buddy_8c_source.html#l00013">BUDDY_BLOCK_ORDER</a>, <a class="el" href="buddy_8h_source.html#l00038">buddy_list_bucket::count</a>, <a class="el" href="buddy_8h_source.html#l00011">FREE</a>, <a class="el" href="buddy_8h_source.html#l00030">INVALID</a>, <a class="el" href="buddy_8h_source.html#l00040">buddy_list_bucket::is_valid</a>, <a class="el" href="buddy_8h_source.html#l00039">buddy_list_bucket::order</a>, <a class="el" href="buddy_8h_source.html#l00025">buddy_list::size</a>, <a class="el" href="tw-util_8c_source.html#l00203">tw_calloc()</a>, <a class="el" href="ross-extern_8h_source.html#l00164">TW_LOC</a>, <a class="el" href="buddy_8h_source.html#l00026">buddy_list::use</a>, and <a class="el" href="buddy_8h_source.html#l00030">VALID</a>.</p>

<p>Referenced by <a class="el" href="tw-setup_8c_source.html#l00448">setup_pes()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_cgraph.png" border="0" usemap="#buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_cgraph" alt=""/></div>
<map name="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_cgraph" id="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_cgraph">
<area shape="rect" id="node2" href="ross-extern_8h.html#a445b1ed30cd2e8ef1f837e782a339a70" title="tw_calloc" alt="" coords="189,31,267,57"/><area shape="rect" id="node3" href="tw-util_8c.html#a57c62eebb6371a6d0d5ea5043f12f91b" title="pool_alloc" alt="" coords="315,5,395,32"/><area shape="rect" id="node5" href="tw-util_8c.html#a653cb2b88ee27b886ba5c854d5a0ba5c" title="tw_error" alt="" coords="320,56,389,83"/><area shape="rect" id="node4" href="tw-util_8c.html#a0611e23c33bb8c31272e79d876b8bcb0" title="my_malloc" alt="" coords="449,5,535,32"/><area shape="rect" id="node6" href="network-mpi_8c.html#a2e139e8547a091c4c4ea0b445fe8dd1c" title="tw_net_abort" alt="" coords="443,56,541,83"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_icgraph.png" border="0" usemap="#buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_icgraph" alt=""/></div>
<map name="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_icgraph" id="buddy_8h_ac7158d51ffbe54dd3e04d6568f90c42c_icgraph">
<area shape="rect" id="node2" href="tw-setup_8c.html#a33b10808894f8c4d429e391810d96e08" title="setup_pes" alt="" coords="189,5,272,32"/><area shape="rect" id="node3" href="tw-setup_8c.html#a6dbc4bba03285bb1b8a8a5464f0375ea" title="tw_run" alt="" coords="320,5,381,32"/><area shape="rect" id="node4" href="phold_8c.html#a3c04138a5bfe5d72780bb7e82a18e627" title="main" alt="" coords="429,5,480,32"/></map>
</div>
</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
